// 7_8.c  Passing Addresses to a Function
#include <stdio.h>

int main()
{
    void calc(float, float, float, float *, float *); /*prototype*/
    float firstnum, secnum, thirdnum, sum, product;

    printf("Enter three number: ");
    scanf("%f %f %f", &firstnum, &secnum, &thirdnum);

    calc(firstnum, secnum, thirdnum, &sum, &product); /*function call*/

    printf("\nThe sum of the entered numbers: %5.2f \n", sum);
    printf("\nThe product of the entered numbers is : %6.2f\n", product);

    return 0;
}

void calc(float num1, float num2, float num3, float *sumaddr, float *prodaddr) /*function header using a pointer parameter*/
{

    *sumaddr = num1 + num2 + num3;
    *prodaddr = num1 * num2 * num3;
}